#include <cmath>
#include <iostream>
#include <random>
using namespace std;

struct RealRandom {
  std::random_device rd;
  std::mt19937 gen;
  std::uniform_real_distribution<> dist;
  std::default_random_engine dgen;

  /**
   * @brief 左闭右开
   *
   * @param begin
   * @param end
   */
  RealRandom(const double &begin, const double &end)
      : rd{}, gen(rd()), dist(begin, end), dgen{} {}

  double operator()() { return dist(gen); }
  double operator()(int a) { return dist(dgen); }
};

int main() {
  RealRandom rrand(0, 1);
  cout << rrand(2) << endl;
  return 0;
}